package com.yql.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yql.dao.CompanyDao;
import com.yql.entity.Company;
import com.yql.entity.Yuans;
import com.yql.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompanyServiceImpl implements CompanyService {
    @Autowired
    CompanyDao companyDao;
    @Override
    public PageInfo<Company> listAll(Company company, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Company> list = companyDao.listAll(company);
        return new PageInfo<>(list);
    }

    @Override
    public Yuans getyid(String cname) {
        return companyDao.getyid(cname);
    }

    @Override
    public Integer add(Company company) {
        return companyDao.add(company);
    }

    @Override
    public List<Yuans> listYuans() {
        return companyDao.listYuans();
    }
}
